package com.example.ssmxuankeback.dto;

import com.example.ssmxuankeback.annotation.ValueInIntegers;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

@Data
@Schema(name = "UserDTO", description = "用户数据传输对象")
public class UserDTO {
    //dto没有创建与修改时间

    @NotNull(message = "学工号不得为空")
    @Schema(description = "学工号")
    private Long id;

    @Length(min = 2, max = 50, message = "用户姓名长度必须大于2小于50")
    @Schema(description = "用户姓名")
    private String name;

    @ValueInIntegers(value = {0, 1}, message = "性别只允许为:0-女,1-男")
    @Schema(description = "性别(0-女,1-男)")
    private Integer gender;

    @Schema(description = "班级编号（学生-所属班级，老师-所管班级）")
    @NotEmpty(message = "班级编号不得为空")
    private Integer classId;

    @ValueInIntegers(value = {0, 1}, message = "用户类型只允许为:0-学生,1-老师")
    @Schema(description = "用户类型(0-学生,1-老师)")
    private Integer userType;

    @Length(min = 11, max = 11, message = "请输入正确的手机号码")
    @Schema(description = "手机号码")
    private String phone;
    @Length(min = 6, max = 18, message = "密码长度必须大于6小于18")
    @Schema(description = "密码")
    private String password;
}